<div class="container-fluid p-0 m-0">
  <div class="row">
    <div class="col-sm-10">
      <h1>Edit of {{renderResult?.type_information?.type_label}} #{{renderResult?.object_information?.object_id}}</h1>
    </div>
    <div class="col-sm-2 text-right">
      <div class="btn-group p-1" role="group">
        <button type="submit" class="btn btn-outline-success mr-2"
                (click)="editObject()"
                [disabled]="!renderForm.dirty">Save</button>
        <button class="btn btn-outline-danger"
                routerLink="/framework/object/view/{{renderResult?.object_information?.object_id}}">Cancel
        </button>
      </div>
    </div>
  </div>
</div>
<hr/>
<div id="object-edit" class="card">
  <div class="card-body">
    <form [formGroup]="renderForm" class="renderForm needs-validation" novalidate autocomplete="off"
          (ngSubmit)="editObject()">
      <cmdb-render [renderResult]="renderResult" [typeInstance]="typeInstance" [mode]="mode"
                   [renderForm]="renderForm"></cmdb-render>
      <hr/>
      <form [formGroup]="commitForm" class="renderForm needs-validation" novalidate autocomplete="off">
        <fieldset class="log-comment">
          <legend>Edit comment</legend>
          <div class="input-group">
          <textarea maxlength="255" class="form-control" formControlName="comment" id="edit_comment"
                    rows="3"></textarea>
          </div>
          <small class="description form-text text-muted">The comment is only listed in the logs and should be additional
            information about the change.</small>
        </fieldset>
      </form>
      <div id="object-form-action" class="shadow p-3 mb-5 bg-white rounded text-center">
        <div class="row d-flex justify-content-center align-items-center">
          <p class="pt-3 mx-4">Do you want to save the changes of
            <strong>{{renderResult?.type_information?.type_label}} #{{renderResult?.object_information?.object_id}}</strong>
            you made before quitting?</p>
          <div class="btn-group p-3" role="group">
            <button type="submit" class="btn btn-outline-success mr-2"
                    [disabled]="!renderForm.dirty">Save</button>
            <button class="btn btn-outline-danger"
                    routerLink="/framework/object/view/{{renderResult?.object_information?.object_id}}">Cancel
            </button>
          </div>
        </div>
      </div>
    </form>
  </div>
</div>
